﻿<!DOCTYPE HTML>
<html lang="en-US">
<head>
	<meta charset="UTF-8">
	<title>Quene_exec test</title>
	<script type="text/javascript" src="js/quene_exec.js"></script>
</head>
<body>
<pre style="background:#f2f2f2;padding:10px;">
var LogExec = new queneExec(function(item){
   document.getElementById("c").innerHTML += "&lt;li&gt;&quot;+item+&quot;&lt;/li&gt;&quot;;
},null,1000);

LogExec
	.add("1")
	.add("2")
	.add("3")
	.add("4")
	.add("5")
	.add("6")
	.add("7")
	.add("8");
</pre>
	<button id="btn1">without queneExec</button>
	<button id="btn2">with queneExec</button>
	<ul id="c"></ul>
	<script>
(function(){
	var i, 
		length = 1000,
		el = document.getElementById("c"),
		
		fn = function(item){
		   el.innerHTML += "<li>+++++++++++++++++++++++++++++"+item+"</li>";
		},
		
		type1 = function(){
			el.innerHTML = '';
			for(i=length;i>0;i--){
				fn(i);
			}
		},
		
		type2 = function(){
			var LogExec = new queneExec(fn,null,0);
			el.innerHTML = '';
			
			for(i=length;i>0;i--){
				LogExec.add(i);
			};
		},
		btn1 = document.getElementById("btn1"),
		btn2 = document.getElementById("btn2");
		
		btn1.onclick = function(){
			type1();
		};
		btn2.onclick = function(){
			type2();
		};
		
})()
		
	</script>
</body>
</html>